import request from '@/config/axios'

export interface TeacherVO {
  id: number
  teacherName: string
  teacherCode: string
  schoolId: number
  collegeId: number
  classesId: number
  sex: number
}

// 查询老师分页
export const getTeacherPage = async (params) => {
  return await request.get({ url: `/cmis/teacher/page`, params })
}

// 查询老师列表
export const getTeacherList = async (params) => {
  return await request.get({ url: `/cmis/teacher/list`, params })
}

// 查询跑步老师信息列表
export const queryTeacherList = async (data) => {
  return await request.post({ url: `/cmis/teacher/query`, data })
}

// 查询老师详情
export const getTeacher = async (id: number) => {
  return await request.get({ url: `/cmis/teacher/get?id=` + id })
}

// 新增老师
export const createTeacher = async (data: TeacherVO) => {
  return await request.post({ url: `/cmis/teacher/create`, data })
}

// 修改老师
export const updateTeacher = async (data: TeacherVO) => {
  return await request.put({ url: `/cmis/teacher/update`, data })
}

// 删除老师
export const deleteTeacher = async (id: number) => {
  return await request.delete({ url: `/cmis/teacher/delete?id=` + id })
}

// 导出老师 Excel
export const exportTeacher = async (params) => {
  return await request.download({ url: `/cmis/teacher/export-excel`, params })
}

// 批量删除老师
export const batchDeleteTeacher = async (ids: Array<string>) => {
  return await request.delete({ url: `/cmis/teacher/batchDelete?ids=` + ids })
}

// 批量导入学生
export const importTeacher = async (data) => {
  return await request.post({ url: `/cmis/teacher/import`, data })
}
